exports.deleteCategory = (req,res) => {

    //获取参数信息
    var bodyParams = req.routeInfo.bodyParams;

    //查询该分类下是否有新闻信息
    function searchNewsInfo(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.productAdd.Request_Api_Url,
                method : 'POST',
                data   : {
                    
                }
            },
            function (data) {

                if(data.result.count > 0){
                    return RES.errorResponse(res,"抱歉，该分类下有新闻信息，不能进行删除");
                }

                cb();
                
            }
        )

    }

    //删除分类
    function deleteNewsCategroy(cb){

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.newsDeleteCategory.Request_Api_Url,
                method : 'POST',
                data   : {
                    delete_where : "nc_id",
                    nc_id        : bodyParams.nc_id,
                    nc_is_delete : 1

                }
            },
            function (data) {

                cb();
                
            }
        )
    }

    F.Serial([searchNewsInfo,deleteNewsCategroy],() => {
        RES.successResponse(res);
    })

    
 }